package com.telsoft.adapter;

import java.util.ArrayList;
import java.util.List;

import com.telsoft.kqxs.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.RadioButton;
import android.widget.CheckBox;
import android.widget.RadioGroup;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.TextView;

public class SettingAdapter extends Activity{
	private CheckBox checkBox;
	  private TextView txtCheckBox, txtRadio;
	  private RadioButton rb1;
	  private Spinner spinner;

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.settings);
        checkBox = (CheckBox) findViewById(R.id.checkBox1);
        txtCheckBox = (TextView) findViewById(R.id.textView2);
        txtRadio = (TextView) findViewById(R.id.textView3);
        rb1 = (RadioButton) findViewById(R.id.radioButton1);
        spinner = (Spinner) findViewById(R.id.Spinner);
        // React to events from the CheckBox
        checkBox.setOnClickListener(new CheckBox.OnClickListener() {
          public void onClick(View v){
                if (checkBox.isChecked()) {
                    txtCheckBox.setText("CheckBox: Box is checked");
                }
                else
                {
                  txtCheckBox.setText("CheckBox: Not checked");
                }
          }
        });
        // React to events from the RadioGroup
        rb1.setOnClickListener(new RadioGroup.OnClickListener() {
          public void onClick(View v){
            txtRadio.setText("Radio: Button 1 picked");
          }
        });
                
  // Set up the Spinner entries
        List<String> lsMusketeers = new ArrayList<String>();
        lsMusketeers.add("Small");
        lsMusketeers.add("Normal");
        lsMusketeers.add("Larg");
        ArrayAdapter<String> aspnMusketeers = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, lsMusketeers);
        aspnMusketeers.setDropDownViewResource
           (android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(aspnMusketeers);
    // Set up a callback for the spinner
    spinner.setOnClickListener(
        new OnClickListener() {
            public void onClick(View arg0) {
//				 TODO Auto-generated method stub				
			}
        });
    }
}
